package com.transcendence.core.utils.glide;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.transcendence.core.utils.date.DateUtils;

/**
 * @author joephone
 * @date 2023/10/27
 * @desc
 */
public class GlideUtils {

    static GlideUtils instance;
    /*
     * 单例模式中获取唯一的Utli实例
     */
    public static GlideUtils getInstance() {
        if (null == instance) {
            instance = new GlideUtils();
        }
        return instance;
    }

    public void load(Context context, String url, ImageView iv){
        this.load(context,url,iv,0);
    }

    public  void load(Context context, String url, ImageView iv, int tag){
        this.load(context,url,iv,tag);
    }

    public void load(Context context, String url, ImageView iv, int r,int tag){
        Glide.with(context).load(url).transform(new GlideRoundTransform(context, r)).into(iv);
    }

}
